//
//  XRNetTool.h
//  XRMyApp
//
//  Created by XRG on 16/5/11.
//  Copyright © 2016年 XRG. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void(^blockOfSuccess)(id result);
typedef void(^blockOfFailure)(NSError *error);

typedef NS_ENUM(NSUInteger, XRResponseStyle) {
    XRJSON,
    XRDATA,
    XRXML,
};

typedef NS_ENUM(NSUInteger, XRRequestStyle) {
    XRBodyJSON,
    XRBodyString,
};


@interface XRNetTool : NSObject

+ (void)GetNetWithUrl:(NSString *)url
                 body:(id)body
               header:(NSDictionary *)headers
             response:(XRResponseStyle)response
              success:(blockOfSuccess)success
              failure:(blockOfFailure)failure;

+ (void)PostNetWithUrl:(NSString *)url
                  body:(id)body
             bodyStyle:(XRRequestStyle)bodyStyle
                header:(NSDictionary *)headers
              response:(XRResponseStyle)response
               success:(blockOfSuccess)success
               failure:(blockOfFailure)failure;

@end
